﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc.Ajax;
using RedSand.Web.Language;

namespace RedSand.Site
{
    public class AdminAjaxOptions
    {
        public static System.Web.Mvc.Ajax.AjaxOptions GetForm
        {
            get
            {
                return new System.Web.Mvc.Ajax.AjaxOptions { UpdateTargetId = "info-wrap", LoadingElementId = "loading-panel", OnFailure = "ajax_failure", OnSuccess = "ajax_get_form_success" };
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions CreateNew
        {
            get
            {
                return GetList;
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions UpdateRecord
        {
            get
            {
                return GetList;
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions ChangePassword
        {
            get
            {
                return new System.Web.Mvc.Ajax.AjaxOptions { UpdateTargetId = "info-wrap", LoadingElementId = "loading-panel", OnFailure = "ajax_failure", OnSuccess = "ajax_change_password_success" };
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions DeleteRecord
        {
            get
            {
                var ajaxoption = GetList;
                ajaxoption.Confirm = "Do you want delete this record";
                return ajaxoption;
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions DeleteRecords
        {
            get
            {
                var ajaxoption = GetList;
                ajaxoption.Confirm = "do you want delete this recoreds";
                return ajaxoption;
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions Paging
        {
            get
            {
                var ajaxoption = GetList;
                ajaxoption.LoadingElementId = "pager-loading-panel";
                return ajaxoption;
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions Search
        {
            get
            {
                return GetList;
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions GetList
        {
            get
            {
                return new System.Web.Mvc.Ajax.AjaxOptions { UpdateTargetId = "list-wrap", LoadingElementId = "loading-panel", OnFailure = "ajax_failure", OnSuccess = "ajax_get_list_success" };
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions GetProperty
        {
            get
            {
                return new System.Web.Mvc.Ajax.AjaxOptions { UpdateTargetId = "property-wrap", LoadingElementId = "loading-panel", OnFailure = "ajax_failure", OnSuccess = "ajax_get_property_success" };
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions GetProperties
        {
            get
            {
                return new System.Web.Mvc.Ajax.AjaxOptions { UpdateTargetId = "properties", LoadingElementId = "loading-panel", OnFailure = "ajax_failure", OnSuccess = "ajax_get_properties_success" };
            }
        }
        public static System.Web.Mvc.Ajax.AjaxOptions DeleteProperty
        {
            get
            {
                var ajaxoption = GetProperties;
                ajaxoption.Confirm = "Do you want delete this record";
                return ajaxoption;
            }
        }
    }
}